﻿using System;
using System.IO.IsolatedStorage;
using System.Diagnostics;

namespace Community.CsharpSqlite.Desktop
{
#if GWNDESKTOP
    /// <summary>
    /// Application Version - FUTURE USE
    /// manage versions
    /// </summary>
    public class ApplicationVersion
    {
        /// <summary>
        /// Gets the isolated storage file.  Called by Sqlite os_win to get 
        /// isolated storage area.  Intended to be used as an application
        /// single entry point for obtaining isolated storage file reference
        /// </summary>
        /// <returns></returns>
        public IsolatedStorageFile GetIsolatedStorageFile()
        {
            IsolatedStorageFile isolatedStorage = null;
            try
            {
                isolatedStorage = IsolatedStorageFile.GetStore(
                    IsolatedStorageScope.User | IsolatedStorageScope.Assembly,
                    null, null);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("***ERROR: " + ex.Message + ex.StackTrace);
            }
            return isolatedStorage;
        }
    }
#endif
}
